/*
 * MIT License
 *
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 *
 * ------------------------------------------------------------------------------
 * <auto-generated>
 * This code was generated by a tool at:
 * /utils/doclint/generateDotnetApi.js
 *
 * Changes to this file may cause incorrect behavior and will be lost if
 * the code is regenerated.
 * </auto-generated>
 * ------------------------------------------------------------------------------
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.Playwright
{
	/// <summary>
	/// <para>
	/// ElementHandle represents an in-page DOM element. ElementHandles can be created with
	/// the <see cref="IPage.QuerySelectorAsync"/> method.
	/// </para>
	/// <para>
	/// ElementHandle prevents DOM element from garbage collection unless the handle is
	/// disposed with <see cref="IJSHandle.DisposeAsync"/>. ElementHandles are auto-disposed
	/// when their origin frame gets navigated.
	/// </para>
	/// <para>
	/// ElementHandle instances can be used as an argument in <see cref="IPage.EvalOnSelectorAsync"/>
	/// and <see cref="IPage.EvaluateAsync"/> methods.
	/// </para>
	/// </summary>
	/// <remarks>Inherits from <see cref="IJSHandle"/></remarks>
	public partial interface IElementHandle : IJSHandle
	{
		/// <summary>
		/// <para>
		/// This method returns the bounding box of the element, or <c>null</c> if the element
		/// is not visible. The bounding box is calculated relative to the main frame viewport
		/// - which is usually the same as the browser window.
		/// </para>
		/// <para>
		/// Scrolling affects the returned bonding box, similarly to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect">Element.getBoundingClientRect</a>.
		/// That means <c>x</c> and/or <c>y</c> may be negative.
		/// </para>
		/// <para>
		/// Elements from child frames return the bounding box relative to the main frame, unlike
		/// the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect">Element.getBoundingClientRect</a>.
		/// </para>
		/// <para>
		/// Assuming the page is static, it is safe to use bounding box coordinates to perform
		/// input. For example, the following snippet should click the center of the element.
		/// </para>
		/// </summary>
		Task<ElementHandleBoundingBoxResult> BoundingBoxAsync();

		/// <summary>
		/// <para>This method checks the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Ensure that element is a checkbox or a radio input. If not, this method throws.
		/// If the element is already checked, this method returns immediately.
		/// </description></item>
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>Use <see cref="IPage.Mouse"/> to click in the center of the element.</description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <paramref name="noWaitAfter"/>
		/// option is set.
		/// </description></item>
		/// <item><description>Ensure that the element is now checked. If not, this method throws.</description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task CheckAsync(Position position = default, bool? force = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>This method clicks the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>
		/// Use <see cref="IPage.Mouse"/> to click in the center of the element, or the specified
		/// <paramref name="position"/>.
		/// </description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <paramref name="noWaitAfter"/>
		/// option is set.
		/// </description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <param name="button">Defaults to <c>left</c>.</param>
		/// <param name="clickCount">defaults to 1. See <see cref="UIEvent.detail"/>.</param>
		/// <param name="delay">
		/// Time to wait between <c>mousedown</c> and <c>mouseup</c> in milliseconds. Defaults
		/// to 0.
		/// </param>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="modifiers">
		/// Modifier keys to press. Ensures that only these modifiers are pressed during the
		/// operation, and then restores current modifiers back. If not specified, currently
		/// pressed modifiers are used.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task ClickAsync(MouseButton button = default, int? clickCount = default, float? delay = default, Position position = default, IEnumerable<KeyboardModifier> modifiers = default, bool? force = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// Returns the content frame for element handles referencing iframe nodes, or <c>null</c>
		/// otherwise
		/// </para>
		/// </summary>
		Task<IFrame> ContentFrameAsync();

		/// <summary>
		/// <para>This method double clicks the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>
		/// Use <see cref="IPage.Mouse"/> to double click in the center of the element, or the
		/// specified <paramref name="position"/>.
		/// </description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <paramref name="noWaitAfter"/>
		/// option is set. Note that if the first click of the <c>dblclick()</c> triggers a
		/// navigation event, this method will throw.
		/// </description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <remarks>
		/// <para>
		/// <c>elementHandle.dblclick()</c> dispatches two <c>click</c> events and a single
		/// <c>dblclick</c> event.
		/// </para>
		/// </remarks>
		/// <param name="button">Defaults to <c>left</c>.</param>
		/// <param name="delay">
		/// Time to wait between <c>mousedown</c> and <c>mouseup</c> in milliseconds. Defaults
		/// to 0.
		/// </param>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="modifiers">
		/// Modifier keys to press. Ensures that only these modifiers are pressed during the
		/// operation, and then restores current modifiers back. If not specified, currently
		/// pressed modifiers are used.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task DblClickAsync(MouseButton button = default, float? delay = default, Position position = default, IEnumerable<KeyboardModifier> modifiers = default, bool? force = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// The snippet below dispatches the <c>click</c> event on the element. Regardless of
		/// the visibility state of the element, <c>click</c> is dispatched. This is equivalent
		/// to calling <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click">element.click()</a>.
		/// </para>
		/// <para>
		/// Under the hood, it creates an instance of an event based on the given <paramref
		/// name="type"/>, initializes it with <paramref name="eventInit"/> properties and dispatches
		/// it on the element. Events are <c>composed</c>, <c>cancelable</c> and bubble by default.
		/// </para>
		/// <para>
		/// Since <paramref name="eventInit"/> is event-specific, please refer to the events
		/// documentation for the lists of initial properties:
		/// </para>
		/// <list type="bullet">
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent">DragEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent">FocusEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent">KeyboardEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent">MouseEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent">PointerEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent">TouchEvent</a></description></item>
		/// <item><description><a href="https://developer.mozilla.org/en-US/docs/Web/API/Event/Event">Event</a></description></item>
		/// </list>
		/// <para>
		/// You can also specify <c>JSHandle</c> as the property value if you want live objects
		/// to be passed into the event:
		/// </para>
		/// </summary>
		/// <param name="type">DOM event type: <c>"click"</c>, <c>"dragstart"</c>, etc.</param>
		/// <param name="eventInit">Optional event-specific initialization properties.</param>
		Task DispatchEventAsync(string type, object eventInit = default);

		/// <summary>
		/// <para>Returns the return value of <paramref name="expression"/>.</para>
		/// <para>
		/// The method finds an element matching the specified selector in the <c>ElementHandle</c>s
		/// subtree and passes it as a first argument to <paramref name="expression"/>. See
		/// <a href="./selectors.md">Working with selectors</a> for more details. If no elements
		/// match the selector, the method throws an error.
		/// </para>
		/// <para>
		/// If <paramref name="expression"/> returns a <see cref="Promise"/>, then <see cref="IElementHandle.EvalOnSelectorAsync"/>
		/// would wait for the promise to resolve and return its value.
		/// </para>
		/// <para>Examples:</para>
		/// </summary>
		/// <param name="selector">
		/// A selector to query for. See <a href="./selectors.md">working with selectors</a>
		/// for more details.
		/// </param>
		/// <param name="expression">
		/// JavaScript expression to be evaluated in the browser context. If it looks like a
		/// function declaration, it is interpreted as a function. Otherwise, evaluated as an
		/// expression.
		/// </param>
		/// <param name="arg">Optional argument to pass to <paramref name="expression"/>.</param>
		Task<T> EvalOnSelectorAsync<T>(string selector, string expression, object arg = default);

		/// <summary>
		/// <para>Returns the return value of <paramref name="expression"/>.</para>
		/// <para>
		/// The method finds all elements matching the specified selector in the <c>ElementHandle</c>'s
		/// subtree and passes an array of matched elements as a first argument to <paramref
		/// name="expression"/>. See <a href="./selectors.md">Working with selectors</a> for
		/// more details.
		/// </para>
		/// <para>
		/// If <paramref name="expression"/> returns a <see cref="Promise"/>, then <see cref="IElementHandle.EvalOnSelectorAllAsync"/>
		/// would wait for the promise to resolve and return its value.
		/// </para>
		/// <para>Examples:</para>
		/// </summary>
		/// <param name="selector">
		/// A selector to query for. See <a href="./selectors.md">working with selectors</a>
		/// for more details.
		/// </param>
		/// <param name="expression">
		/// JavaScript expression to be evaluated in the browser context. If it looks like a
		/// function declaration, it is interpreted as a function. Otherwise, evaluated as an
		/// expression.
		/// </param>
		/// <param name="arg">Optional argument to pass to <paramref name="expression"/>.</param>
		Task<T> EvalOnSelectorAllAsync<T>(string selector, string expression, object arg = default);

		/// <summary>
		/// <para>
		/// This method waits for <a href="./actionability.md">actionability</a> checks, focuses
		/// the element, fills it and triggers an <c>input</c> event after filling. If the element
		/// is inside the <c>&lt;label&gt;</c> element that has associated <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>,
		/// that control will be filled instead. If the element to be filled is not an <c>&lt;input&gt;</c>,
		/// <c>&lt;textarea&gt;</c> or <c>[contenteditable]</c> element, this method throws
		/// an error. Note that you can pass an empty string to clear the input field.
		/// </para>
		/// </summary>
		/// <param name="value">
		/// Value to set for the <c>&lt;input&gt;</c>, <c>&lt;textarea&gt;</c> or <c>[contenteditable]</c>
		/// element.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task FillAsync(string value, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus">focus</a>
		/// on the element.
		/// </para>
		/// </summary>
		Task FocusAsync();

		/// <summary><para>Returns element attribute value.</para></summary>
		/// <param name="name">Attribute name to get the value for.</param>
		Task<string> GetAttributeAsync(string name);

		/// <summary>
		/// <para>This method hovers over the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>
		/// Use <see cref="IPage.Mouse"/> to hover over the center of the element, or the specified
		/// <paramref name="position"/>.
		/// </description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <c>noWaitAfter</c>
		/// option is set.
		/// </description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="modifiers">
		/// Modifier keys to press. Ensures that only these modifiers are pressed during the
		/// operation, and then restores current modifiers back. If not specified, currently
		/// pressed modifiers are used.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task HoverAsync(Position position = default, IEnumerable<KeyboardModifier> modifiers = default, bool? force = default, float? timeout = default);

		/// <summary><para>Returns the <c>element.innerHTML</c>.</para></summary>
		Task<string> InnerHTMLAsync();

		/// <summary><para>Returns the <c>element.innerText</c>.</para></summary>
		Task<string> InnerTextAsync();

		/// <summary>
		/// <para>
		/// Returns whether the element is checked. Throws if the element is not a checkbox
		/// or radio input.
		/// </para>
		/// </summary>
		Task<bool> IsCheckedAsync();

		/// <summary><para>Returns whether the element is disabled, the opposite of <a href="./actionability.md#enabled">enabled</a>.</para></summary>
		Task<bool> IsDisabledAsync();

		/// <summary><para>Returns whether the element is <a href="./actionability.md#editable">editable</a>.</para></summary>
		Task<bool> IsEditableAsync();

		/// <summary><para>Returns whether the element is <a href="./actionability.md#enabled">enabled</a>.</para></summary>
		Task<bool> IsEnabledAsync();

		/// <summary><para>Returns whether the element is hidden, the opposite of <a href="./actionability.md#visible">visible</a>.</para></summary>
		Task<bool> IsHiddenAsync();

		/// <summary><para>Returns whether the element is <a href="./actionability.md#visible">visible</a>.</para></summary>
		Task<bool> IsVisibleAsync();

		/// <summary><para>Returns the frame containing the given element.</para></summary>
		Task<IFrame> OwnerFrameAsync();

		/// <summary>
		/// <para>Focuses the element, and then uses <see cref="IKeyboard.DownAsync"/> and <see cref="IKeyboard.UpAsync"/>.</para>
		/// <para>
		/// <paramref name="key"/> can specify the intended <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key">keyboardEvent.key</a>
		/// value or a single character to generate the text for. A superset of the <paramref
		/// name="key"/> values can be found <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values">here</a>.
		/// Examples of the keys are:
		/// </para>
		/// <para>
		/// <c>F1</c> - <c>F12</c>, <c>Digit0</c>- <c>Digit9</c>, <c>KeyA</c>- <c>KeyZ</c>,
		/// <c>Backquote</c>, <c>Minus</c>, <c>Equal</c>, <c>Backslash</c>, <c>Backspace</c>,
		/// <c>Tab</c>, <c>Delete</c>, <c>Escape</c>, <c>ArrowDown</c>, <c>End</c>, <c>Enter</c>,
		/// <c>Home</c>, <c>Insert</c>, <c>PageDown</c>, <c>PageUp</c>, <c>ArrowRight</c>, <c>ArrowUp</c>,
		/// etc.
		/// </para>
		/// <para>
		/// Following modification shortcuts are also supported: <c>Shift</c>, <c>Control</c>,
		/// <c>Alt</c>, <c>Meta</c>, <c>ShiftLeft</c>.
		/// </para>
		/// <para>
		/// Holding down <c>Shift</c> will type the text that corresponds to the <paramref name="key"/>
		/// in the upper case.
		/// </para>
		/// <para>
		/// If <paramref name="key"/> is a single character, it is case-sensitive, so the values
		/// <c>a</c> and <c>A</c> will generate different respective texts.
		/// </para>
		/// <para>
		/// Shortcuts such as <c>key: "Control+o"</c> or <c>key: "Control+Shift+T"</c> are supported
		/// as well. When specified with the modifier, modifier is pressed and being held while
		/// the subsequent key is being pressed.
		/// </para>
		/// </summary>
		/// <param name="key">
		/// Name of the key to press or a character to generate, such as <c>ArrowLeft</c> or
		/// <c>a</c>.
		/// </param>
		/// <param name="delay">
		/// Time to wait between <c>keydown</c> and <c>keyup</c> in milliseconds. Defaults to
		/// 0.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task PressAsync(string key, float? delay = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// The method finds an element matching the specified selector in the <c>ElementHandle</c>'s
		/// subtree. See <a href="./selectors.md">Working with selectors</a> for more details.
		/// If no elements match the selector, returns <c>null</c>.
		/// </para>
		/// </summary>
		/// <param name="selector">
		/// A selector to query for. See <a href="./selectors.md">working with selectors</a>
		/// for more details.
		/// </param>
		Task<IElementHandle> QuerySelectorAsync(string selector);

		/// <summary>
		/// <para>
		/// The method finds all elements matching the specified selector in the <c>ElementHandle</c>s
		/// subtree. See <a href="./selectors.md">Working with selectors</a> for more details.
		/// If no elements match the selector, returns empty array.
		/// </para>
		/// </summary>
		/// <param name="selector">
		/// A selector to query for. See <a href="./selectors.md">working with selectors</a>
		/// for more details.
		/// </param>
		Task<IReadOnlyCollection<IElementHandle>> QuerySelectorAllAsync(string selector);

		/// <summary>
		/// <para>Returns the buffer with the captured screenshot.</para>
		/// <para>
		/// This method waits for the <a href="./actionability.md">actionability</a> checks,
		/// then scrolls element into view before taking a screenshot. If the element is detached
		/// from DOM, the method throws an error.
		/// </para>
		/// </summary>
		/// <param name="path">
		/// The file path to save the image to. The screenshot type will be inferred from file
		/// extension. If <paramref name="path"/> is a relative path, then it is resolved relative
		/// to the current working directory. If no path is provided, the image won't be saved
		/// to the disk.
		/// </param>
		/// <param name="type">Specify screenshot type, defaults to <c>png</c>.</param>
		/// <param name="quality">The quality of the image, between 0-100. Not applicable to <c>png</c> images.</param>
		/// <param name="omitBackground">
		/// Hides default white background and allows capturing screenshots with transparency.
		/// Not applicable to <c>jpeg</c> images. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task<byte[]> ScreenshotAsync(string path = default, ScreenshotType type = default, int? quality = default, bool? omitBackground = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// This method waits for <a href="./actionability.md">actionability</a> checks, then
		/// tries to scroll element into view, unless it is completely visible as defined by
		/// <a href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API">IntersectionObserver</a>'s
		/// <c>ratio</c>.
		/// </para>
		/// <para>
		/// Throws when <c>elementHandle</c> does not point to an element <a href="https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected">connected</a>
		/// to a Document or a ShadowRoot.
		/// </para>
		/// </summary>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task ScrollIntoViewIfNeededAsync(float? timeout = default);

		/// <summary>
		/// <para>Returns the array of option values that have been successfully selected.</para>
		/// <para>
		/// Triggers a <c>change</c> and <c>input</c> event once all the provided options have
		/// been selected. If element is not a <c>&lt;select&gt;</c> element, the method throws
		/// an error.
		/// </para>
		/// <para>Will wait until all specified options are present in the <c>&lt;select&gt;</c> element.</para>
		/// </summary>
		/// <param name="values">
		/// Options to select. If the <c>&lt;select&gt;</c> has the <c>multiple</c> attribute,
		/// all matching options are selected, otherwise only the first option matching one
		/// of the passed options is selected. String values are equivalent to <c>{value:'string'}</c>.
		/// Option is considered matching if all specified properties match.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task<IReadOnlyCollection<string>> SelectOptionAsync(IEnumerable<SelectOptionValue> values, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>
		/// This method waits for <a href="./actionability.md">actionability</a> checks, then
		/// focuses the element and selects all its text content.
		/// </para>
		/// </summary>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task SelectTextAsync(float? timeout = default);

		/// <summary>
		/// <para>
		/// This method expects <c>elementHandle</c> to point to an <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input">input
		/// element</a>.
		/// </para>
		/// <para>
		/// Sets the value of the file input to these file paths or files. If some of the <c>filePaths</c>
		/// are relative paths, then they are resolved relative to the the current working directory.
		/// For empty array, clears the selected files.
		/// </para>
		/// </summary>
		/// <param name="files">
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task SetInputFilesAsync(IEnumerable<FilePayload> files, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>This method taps the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>
		/// Use <see cref="IPage.Touchscreen"/> to tap the center of the element, or the specified
		/// <paramref name="position"/>.
		/// </description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <paramref name="noWaitAfter"/>
		/// option is set.
		/// </description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <remarks>
		/// <para>
		/// <c>elementHandle.tap()</c> requires that the <c>hasTouch</c> option of the browser
		/// context be set to true.
		/// </para>
		/// </remarks>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="modifiers">
		/// Modifier keys to press. Ensures that only these modifiers are pressed during the
		/// operation, and then restores current modifiers back. If not specified, currently
		/// pressed modifiers are used.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task TapAsync(Position position = default, IEnumerable<KeyboardModifier> modifiers = default, bool? force = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary><para>Returns the <c>node.textContent</c>.</para></summary>
		Task<string> TextContentAsync();

		/// <summary>
		/// <para>
		/// Focuses the element, and then sends a <c>keydown</c>, <c>keypress</c>/<c>input</c>,
		/// and <c>keyup</c> event for each character in the text.
		/// </para>
		/// <para>To press a special key, like <c>Control</c> or <c>ArrowDown</c>, use <see cref="IElementHandle.PressAsync"/>.</para>
		/// <para>An example of typing into a text field and then submitting the form:</para>
		/// </summary>
		/// <param name="text">A text to type into a focused element.</param>
		/// <param name="delay">Time to wait between key presses in milliseconds. Defaults to 0.</param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task TypeAsync(string text, float? delay = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>This method checks the element by performing the following steps:</para>
		/// <list type="ordinal">
		/// <item><description>
		/// Ensure that element is a checkbox or a radio input. If not, this method throws.
		/// If the element is already unchecked, this method returns immediately.
		/// </description></item>
		/// <item><description>
		/// Wait for <a href="./actionability.md">actionability</a> checks on the element, unless
		/// <paramref name="force"/> option is set.
		/// </description></item>
		/// <item><description>Scroll the element into view if needed.</description></item>
		/// <item><description>Use <see cref="IPage.Mouse"/> to click in the center of the element.</description></item>
		/// <item><description>
		/// Wait for initiated navigations to either succeed or fail, unless <paramref name="noWaitAfter"/>
		/// option is set.
		/// </description></item>
		/// <item><description>Ensure that the element is now unchecked. If not, this method throws.</description></item>
		/// </list>
		/// <para>
		/// If the element is detached from the DOM at any moment during the action, this method
		/// throws.
		/// </para>
		/// <para>
		/// When all steps combined have not finished during the specified <paramref name="timeout"/>,
		/// this method throws a <see cref="ITimeoutError"/>. Passing zero timeout disables
		/// this.
		/// </para>
		/// </summary>
		/// <param name="position">
		/// A point to use relative to the top-left corner of element padding box. If not specified,
		/// uses some visible point of the element.
		/// </param>
		/// <param name="force">
		/// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults
		/// to <c>false</c>.
		/// </param>
		/// <param name="noWaitAfter">
		/// Actions that initiate navigations are waiting for these navigations to happen and
		/// for pages to start loading. You can opt out of waiting via setting this flag. You
		/// would only need this option in the exceptional cases such as navigating to inaccessible
		/// pages. Defaults to <c>false</c>.
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task UncheckAsync(Position position = default, bool? force = default, bool? noWaitAfter = default, float? timeout = default);

		/// <summary>
		/// <para>Returns when the element satisfies the <paramref name="state"/>.</para>
		/// <para>
		/// Depending on the <paramref name="state"/> parameter, this method waits for one of
		/// the <a href="./actionability.md">actionability</a> checks to pass. This method throws
		/// when the element is detached while waiting, unless waiting for the <c>"hidden"</c>
		/// state.
		/// </para>
		/// <list type="bullet">
		/// <item><description><c>"visible"</c> Wait until the element is <a href="./actionability.md#visible">visible</a>.</description></item>
		/// <item><description>
		/// <c>"hidden"</c> Wait until the element is <a href="./actionability.md#visible">not
		/// visible</a> or <a href="./actionability.md#attached">not attached</a>. Note that
		/// waiting for hidden does not throw when the element detaches.
		/// </description></item>
		/// <item><description>
		/// <c>"stable"</c> Wait until the element is both <a href="./actionability.md#visible">visible</a>
		/// and <a href="./actionability.md#stable">stable</a>.
		/// </description></item>
		/// <item><description><c>"enabled"</c> Wait until the element is <a href="./actionability.md#enabled">enabled</a>.</description></item>
		/// <item><description>
		/// <c>"disabled"</c> Wait until the element is <a href="./actionability.md#enabled">not
		/// enabled</a>.
		/// </description></item>
		/// <item><description><c>"editable"</c> Wait until the element is <a href="./actionability.md#editable">editable</a>.</description></item>
		/// </list>
		/// <para>
		/// If the element does not satisfy the condition for the <paramref name="timeout"/>
		/// milliseconds, this method will throw.
		/// </para>
		/// </summary>
		/// <param name="state">A state to wait for, see below for more details.</param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task WaitForElementStateAsync(ElementState state, float? timeout = default);

		/// <summary>
		/// <para>
		/// Returns element specified by selector when it satisfies <paramref name="state"/>
		/// option. Returns <c>null</c> if waiting for <c>hidden</c> or <c>detached</c>.
		/// </para>
		/// <para>
		/// Wait for the <paramref name="selector"/> relative to the element handle to satisfy
		/// <paramref name="state"/> option (either appear/disappear from dom, or become visible/hidden).
		/// If at the moment of calling the method <paramref name="selector"/> already satisfies
		/// the condition, the method will return immediately. If the selector doesn't satisfy
		/// the condition for the <paramref name="timeout"/> milliseconds, the function will
		/// throw.
		/// </para>
		/// </summary>
		/// <remarks>
		/// <para>
		/// This method does not work across navigations, use <see cref="IPage.WaitForSelectorAsync"/>
		/// instead.
		/// </para>
		/// </remarks>
		/// <param name="selector">
		/// A selector to query for. See <a href="./selectors.md">working with selectors</a>
		/// for more details.
		/// </param>
		/// <param name="state">
		/// Defaults to <c>'visible'</c>. Can be either:
		/// <list type="bullet">
		/// <item><description><c>'attached'</c> - wait for element to be present in DOM.</description></item>
		/// <item><description><c>'detached'</c> - wait for element to not be present in DOM.</description></item>
		/// <item><description>
		/// <c>'visible'</c> - wait for element to have non-empty bounding box and no <c>visibility:hidden</c>.
		/// Note that element without any content or with <c>display:none</c> has an empty bounding
		/// box and is not considered visible.
		/// </description></item>
		/// <item><description>
		/// <c>'hidden'</c> - wait for element to be either detached from DOM, or have an empty
		/// bounding box or <c>visibility:hidden</c>. This is opposite to the <c>'visible'</c>
		/// option.
		/// </description></item>
		/// </list>
		/// </param>
		/// <param name="timeout">
		/// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout.
		/// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/>
		/// or <see cref="IPage.SetDefaultTimeout"/> methods.
		/// </param>
		Task<IElementHandle> WaitForSelectorAsync(string selector, WaitForSelectorState state = default, float? timeout = default);
	}
}
